<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>分类管理</title>
    <script type="text/javascript" src="http://localhost/jumei/Static/js/jquery-1.7.2.min.js"></script>
    <link rel="stylesheet" href="http://localhost/jumei/Static/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://localhost/jumei/Static/hdjs/hdjs.css">
    <script type="text/javascript" src="http://localhost/jumei/Static/hdjs/hdjs.min.js"></script>
</head>
<body>
<div class="wrap">
    <div class="hd-title-header">修改分类</div>
    <form action="javascript:;" onsubmit="return hd_submit(this,'<?php echo U('Category/edit');?>','<?php echo U('Category/index');?>')" class="form-inline hd-form">
        <table class="hd-table hd-table-list">
            <tr>
                <th class="w100">分类名称</th>
                <td  class="w100">
                    <input type="text" name="cname" class="w200" value="<?php echo $data['cname'];?>" /> 
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="pid" class="w200">
                        <option value="0">顶级分类</option>
                        <?php foreach ($top_cate as $k=>$v){?>
                            <option value="<?php echo $v['cid'];?>"    <?php if($data['pid']==$v['cid']){ ?>selected="selected"<?php } ?>><?php echo $v['cname'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td></td>
            </tr>
                <?php if($data['pid']){ ?>
                <tr>
                    <th class="w100">所属类型</th>
                    <td>
                        <select name="f_type_tid" class="w200">
                            <!-- <option value="">请选择类型</option> -->
                            <?php foreach ($type_data as $k=>$v){?>
                                <option value="<?php echo $v['tid'];?>"     <?php if($data['f_type_tid']==$v['tid']){ ?>selected="selected"<?php } ?>><?php echo $v['tname'];?></option>
                            <?php }?>
                        </select>
                    </td>
                    <td></td>
                </tr>
            <?php } ?>
            <tr>
                <th class="w100">分类排序</th>
                <td>
                    <input type="text" name="sort" class="w200" value="100"/>
                </td>
                <td>请填写1到65535的排序数字 </td>
            </tr>
        </table>
        <div class="position-bottom">
            <input type="hidden" name="cid" value="<?php echo $data['cid'];?>" />
            <input type="submit" class="btn btn-primary" value="修改" style="margin:20px 20px 0px 20px" />
            <input type="button" class="btn btn-danger" value="返回" style="margin:20px 20px 0px 0px" />
        </div>
        <script type="text/javascript">
            $('.position-bottom .hd-btn-danger').click(function() {
                location.href="<?php echo U('Category/index');?>"
            });
        </script>
    </form>
</div>
</body>
</html>